package stool.sort;

import static stool.sort.resource.ResourceClass.findIntArr;
import static stool.sort.resource.ResourceClass.print;

/**
 * @author Felix YF Dong
 * @Description 希尔排序
 * @Date 2022-07-07
 */
public class ShellSort {

    public static void main(String[] args) {
        int[] arr = findIntArr();
        shellSort(arr);
        print(arr);
    }

    /**
     * 分组插入排序
     * @param arr 排序数组
     */
    public static void shellSort(int[] arr) {

        int len = arr.length;
        while (len != 0) {
            len = len/2;
            InsertionSort.insertionSort(arr, len);
        }

    }
}
